<?php
$codigo_html = "";
$codigo_html .= "\n<div id='map' style='float:left; width: 800px; height: 600px'>Aguarde un instante mientras se carga el mapa.</div>";
$codigo_html .= "\n<div id='referencias' style='padding-left:10px; float:left; width: 100px; height: 500px'>";
$codigo_html .= "\n<b>Referencias</b>";
$codigo_html .= "\n<br/>";
$codigo_html .= "\n" . $presentacion->image("marcadores/verde.png", array("width"=>"10px", "height"=>"10px"));
$codigo_html .= "\nHumedad < 8";
$codigo_html .= "\n<br/>";
$codigo_html .= "\n" . $presentacion->image("marcadores/rojo.png", array("width"=>"10px", "height"=>"10px"));
$codigo_html .= "\nHumedad > 8";
$codigo_html .= "\n</div>";


$codigo_html .= "\n<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAac60cfu93AuYNtIBqo2aixQB7RJ7W5cRoy4cusD5bnh27KDc5xRwEI5ywj6KRDbWKSPk_iVLa6BYMQ' type='text/javascript'></script>";

$codigo_html .= "\n" . $javascript->codeblock('


    if (GBrowserIsCompatible()) {

      var map = new GMap(document.getElementById("map"));
      map.addControl(new GScaleControl());
      map.addControl(new GMapTypeControl());
      
      // ============================================================
      // ====== Create a copyright entry =====
      var copyright = new GCopyright(1,
          new GLatLngBounds(new GLatLng(53.8136257,-3.0981445),new GLatLng(53.8654855,-2.9663944) ),
          14, "Ordnance Survey");


      // ============================================================
      // ====== Create a copyright collection =====
      // ====== and add the copyright to it   =====
      var copyrightCollection = new GCopyrightCollection("Map Data:");
      copyrightCollection.addCopyright(copyright);
      

      // ============================================================
      // == Write our own getTileUrl function ========
      // In this case the tiles are names like  8053_5274_3.jpg
      CustomGetTileUrl=function(a,b){
          return "http://econym.googlepages.com/" + a.x+"_"+a.y+"_"+(17-b)+".jpg"
      }


      // ============================================================
      // ===== Create the GTileLayer =====
      // ===== adn apply the CustomGetTileUrl to it
      var tilelayers = [new GTileLayer(copyrightCollection,14,14)];
      tilelayers[0].getTileUrl = CustomGetTileUrl;
      
      
      // ============================================================
      // ===== Create the GMapType =====
      // ===== and add it to the map =====
      var custommap = new GMapType(tilelayers, new GMercatorProjection(15), "EL MIO");
      map.addMapType(custommap);

      map.setCenter(new GLatLng(53.852,-3.038), 14, custommap);
    }

    
    // display a warning if the browser was not compatible
    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }

    // This Javascript is based on code provided by the
    // Blackpool Community Church Javascript Team
    // http://www.commchurch.freeserve.co.uk/   
    // http://econym.googlepages.com/index.htm
	//inicio();
');

echo $codigo_html;
?>